/* 
 * File:   Vertex.h
 * Author: RedEyedKiller
 *
 * Created on 23 Ιούλιος 2011, 5:06 πμ
 */

#ifndef VERTEX_H
#define	VERTEX_H

namespace gl
{

/*
 * A class to represent a 2d vertex point.
 * To draw this vertex call the Apply method.
 */
class Vertex
{
public:

    Vertex()
    {}
    
    Vertex(GLdouble x,GLdouble y)
    {
        xy[0] = x;
        xy[1] = y;
    }

    void Apply()
    {
        glVertex2dv(xy);
    }

    void SetX(GLdouble x)
    {
        xy[0] = x;
    }

    void SetY(GLdouble y)
    {
        xy[1] = y;
    }
    
    void Set(GLdouble x,GLdouble y)
    {
        xy[0] = x;
        xy[1] = y;
    }

    GLdouble X()
    {
        return xy[0];
    }

    GLdouble Y()
    {
        return xy[1];
    }


private:
    GLdouble xy[2];
};
}


#endif	/* VERTEX_H */

